package com.ftg.learn.mapper;

import com.ftg.learn.entity.SysUserEntity;
import com.ftg.learn.vo.SysUserListVo;
import com.ftg.learn.vo.SysUserLoginVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 描述   用户数据模型接口
 * @Mapper  mybatis -
 *  把接口通过动态代理生成一个实现类，然后把实现类注入到spring容器中
 *  Proxy - SysUserMapperProxy
 * @author 布衣
 * @date 2025/2/10
 */
@Mapper
public interface SysUserMapper {

    /**
     * 查询所有用户
     * @return List<SysUserListVo>
     */
    @Select("select user_id userId,username,password,email,mobile,status from tz_sys_user")
    List<SysUserListVo> all();

    @Select("select user_id userId,username,password,email,mobile,status from tz_sys_user where username=#{username}")
    SysUserLoginVo login(@Param("username") String username);
}
